import { matchTypesDetail } from '@/utils/constant'
const state = {
  initData: '',
  matchTypesDetail,
}

const getters = {
  initData: (state) => state.initData,
  matchTypesDetail: (state) => state.matchTypesDetail,
}

const mutations = {
  setInitData(state, initData) {
    if (initData) {
      state.initData = initData
    } else {
      state.initData = []
    }
  },
  setMatchTypesDetail(state, matchTypesDetail) {
    if (matchTypesDetail) {
      state.matchTypesDetail = matchTypesDetail
    } else {
      state.matchTypesDetail = []
    }
  },
}

const actions = {
  setInitData({ commit }, initData) {
    commit('setInitData', initData)
  },
  setMatchTypesDetail({ commit }, matchTypesDetail) {
    commit('setMatchTypesDetail', matchTypesDetail)
  },
}

export default { state, getters, mutations, actions }
